package com.changgou.goods.dao;

import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface SpecMapper extends Mapper<Spec> {

    //根据商品分类名称查询规格列表
    @Select(" SELECT t2.`name`, t2.OPTIONS AS options  FROM  " +
            " tb_category  t1 " +
            " INNER JOIN tb_spec t2 ON " +
            " t1.`template_id` = t2.`template_id` AND t1.`name`= #{Name} ")
    List<Map> findListByCategoryName(@Param("Name") String categoryName);


}
